<template>
  <div class="pk-card" :class="['pk-card-'+ size, {'pk-card-radius': radius}]">
    <div class="pk-card-content">
      <div class="pk-card-header">
      <div class="pk-card-title">
        <div v-if="$slots.headericon" class="mr-8"><slot name="headericon"></slot></div>
        <div>订单合计</div>
      </div>
      <div class="pk-card-hdmore">
        <slot name="headerright"></slot>
      </div>
    </div>
    <div class="pk-card-border" v-if="border">
      <pk-line></pk-line>
    </div>
    <div class="pk-card-body">
      <slot></slot>
    </div>
    <div class="pk-card-footer" v-if="footer"></div>
    </div>
    <div class="pk-card-more" v-if="isMore" @click="onMore"></div> 
  </div>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue'
const emits = defineEmits(['onMore'])
defineProps({
  size:{
    type: String,
    default: 'medium'
  },
  border:{
    type: Boolean,
    default: true
  },
  isMore:{
    type: Boolean,
    default: false
  },
  radius:{
    type: Boolean,
    default: true
  },
  footer:{
    type: Boolean,
    default: true
  }
})


const onMore = () => {
  emits('onMore')
}

</script>

<style lang="scss" scoped>
.pk-card{
  background: #fff;  
  color: $uni-text-color;
  box-shadow: 0px 8rpx 32px 0px rgba(0,0,0,0.06); 
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  &-radius{
    border-radius: $uni-border-radius-base;
  }
  &-content{
    flex:1;
    display:flex;
    flex-direction: column; 
  }
  &-title{
    font-weight: bold;
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  &-more{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64rpx;
    background: url('@/static/pkui/moreicon.png') center center no-repeat;
    background-size: 32rpx auto;
    height: 64rpx;
    padding: 0 24rpx;
  }
  &-header{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center; 
  }
}



.pk-card-small{
  font-size: $uni-font-size-sm;
  .pk-card-body{
    padding: 24rpx 32rpx;
  } 
  .pk-card-header{
    padding: 24rpx;
  } 
  .pk-card-title{
    font-size: $uni-font-size-sm;
  }
}

.pk-card-medium{
  font-size: $uni-font-size-base;
  .pk-card-body{
    padding: 24rpx 32rpx;
  } 
  .pk-card-header{
    padding: 24rpx;
  } 
  .pk-card-title{
    font-size: $uni-font-size-base;
  }
}


.pk-card-large{
  .pk-card-body{
    padding: 24rpx 32rpx;
  } 
  .pk-card-header{
    padding: 24rpx;
  } 
  .pk-card-title{
    font-size: $uni-font-size-lg;
  }
}

</style>